<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix ="c"%>
<%-- jstl 标签库  就是 将一些 java 代码用标签的形式 进行替换--%>
<!DOCTYPE html>
<html>
<head>
    <title>JSP - Hello World</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/list.css">
</head>
<body>
<%--
发请求的三种方式
action = "/路径"

浏览器地址栏直接发起请求
a = href = "/路径"


ajax 异步请求
--%>

<div class="div-body">

<%--    <div class="div-header">--%>
<%--        <h1>头部信息展示数据</h1>--%>
<%--    </div>--%>
    <div class="div-center">

        <div class="div-center-left">
            <%--            ${pageContext.request.contextPath} 获取当前项目名称 --%>
            <div><a href="${pageContext.request.contextPath}/user/list.jsp">用户管理</a></div>
        </div>
        <div class="div-center-right">
            <div class="div-center-right-box">
                <div style="display: flex;flex-direction: row;    justify-content: space-between;">

                    <form action="">
                        账号:<input type="text" name="username">
                        姓名:<input type="text" name="name">
                        <input type="submit" value="查询">
                    </form>

                    <div style="    margin-right: 50px;">
                        <a href="/book/user/addUser.jsp">添加用户</a>
                    </div>

                </div>

                <div>
                    <table border="1px solid ">
                        <tr>
                            <td>序号</td>
                            <td>账号</td>
                            <td>真实姓名</td>
                            <td>年龄</td>
                            <td>操作</td>
                        </tr>

                        <c:forEach items="${users}" var="u">
                            <tr>
                                <td>${u.id}</td>
                                <td>${u.userName}</td>
                                <td>${u.name}</td>
                                <td>${u.age}</td>
                                <td>
                                        <%--                                    1.根据id获取当前需要修改的用户
                                                                                 将这个用户 保存 到作用域中
                                                                                2.修改页面 进行数据回显 ()
                                                                                 3.确定修改

                                                                                            --%>
                                    <a href="/book/user/editUser?id=${u.id}" target="_blank">修改</a>
                                    <a href="/book/user/deleteUser?id=${u.id}">删除</a>
                                </td>
                            </tr>

                        </c:forEach>



                    </table>
                </div>

            </div>
        </div>
    </div>

    <div class="div-footer">
        <h1>底部信息</h1>
    </div>

</div>



</body>
</html>
